import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { SystemLayoutComponent } from './_layout/layout.component';
import { SystemLogsComponent } from './logs/logs.component';
import { SystemDictComponent } from './sysdict/sysdict.component';
import { SysDictItemComponent } from './sysdict/view/sysdict-item.component';
import { SysParamComponent } from './sysparam/sysparam.component';
import { SystemTokenComponent } from './token/token.component';
import { QuartzJobComponent } from './job/quartz.component';
import { DataSourceComponent } from './datasource/datasource.component';

const routes: Routes = [
  {
    path: '',
    component: SystemLayoutComponent,
    children: [
      { path: '', redirectTo: 'log', pathMatch: 'full' },
      { path: 'log', component: SystemLogsComponent },
      { path: 'dict', component: SystemDictComponent },
      { path: 'dict/detail/:dictId', component: SysDictItemComponent },
      { path: 'param', component: SysParamComponent },
      { path: 'token', component: SystemTokenComponent },
      { path: 'job', component: QuartzJobComponent },
      { path: 'dsconf', component: DataSourceComponent },
    ],
  },
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule],
})
export class SystemRoutingModule {}
